# -*- coding: utf-8 -*-

from django.contrib import admin
from models import *

class TelefoneAdmin(admin.TabularInline):
    model = Telefone
    extra = 1
    
class EnderecoAdmin(admin.TabularInline):
    model = Endereco
    extra = 1
    
class CartaoAdmin(admin.TabularInline):
    model = Cartao_Credito
    extra = 1

class AdminCliente(admin.ModelAdmin):
    list_display = ('nome', 'cpf')
    search_fields= ['nome','cpf', 'telefone__numero', 'endereco__rua', 'endereco__cidade', 'endereco__referencia']
    inlines = [EnderecoAdmin, TelefoneAdmin, CartaoAdmin]

admin.site.register(Cliente, AdminCliente)
